import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url';
import { preloadImages } from './plugins/preloadImages.ts';

// https://vite.dev/config/
/** @type {import('vite').UserConfig} */
export default defineConfig({
  plugins: [
    vue(),
    preloadImages({
      dir: 'src/assets/images/*.{jpg,jpeg,png,gif,svg}',
      attrs: {
        rel: 'prefetch',
      }
    }),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
  server: {
    // open: true,
  },
});
